# Makefile for the CS:APP Shell Lab
# some variables describing your program source
# in most cases, you'll only need to edit these four variables
INSTALLOPT = --backup=t -m 644
DRIVER = ./sdriver.pl
PROGRAM = tsh
HEADERS = wrappers.h helper.h proc_creation.h
SOURCES = wrappers.c helper.c parse.c proc_creation.c
OBJECTS = parse.o wrappers.o helper.o proc_creation.o

# some useful others that you may need to edit
CC = gcc
CFLAGS = -Wall -O2
LIBS = 

# name of this file
MF = Makefile

.SUFFIXES: .o .h .c

# ------------- Stuff you shouldn't have to change ------------------

.C.o: $(CC) $(CFLAGS) -c -o $*.o $<

$(PROGRAM): $(OBJECTS)
	$(CC) -o $(PROGRAM) $(CFLAGS) $(OBJECTS) $(LIBS)

clean: 
	@rm -f *~ "#*" *.o $(PROJECT)

depend:
	@echo 'updating the dependencies for:'
	@echo '    ' $(SOURCES)
	@{ \
	< $(MF) sed -n '1,/^###.*SUDDEN DEATH/p'; \
		echo '#' ; \
		echo '# dependencies generated on: ' `date` ; \
		echo '#' ; \
		for i in $(SOURCES); do \
			$(CC) -MM $(CFLAGS) $(DEFINES) $$i ; \
			echo; \
		done \
} > $(MF).new
	@mv $(MF) $(MF).last
	@mv $(MF).new $(MF)

##################### EVERYTHING BELOW THIS LINE IS SUBJECT TO SUDDEN DEATH...
#
# dependencies generated on:  Fri Feb 20 15:07:02 CST 2009
#
wrappers.o: wrappers.c

helper.o: helper.c helper.h

parse.o: parse.c

proc_creation.o: proc_creation.c helper.h wrappers.h

